package cn.jiyun.service.impl;

import cn.jiyun.entity.Sblx;
import cn.jiyun.mapper.SblxMapper;
import cn.jiyun.service.ISblxService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2024-10-27
 */
@Service
public class SblxServiceImpl extends ServiceImpl<SblxMapper, Sblx> implements ISblxService {

    @Override
    public Page findPage(Integer pageNum, Integer pageSize, Sblx sblx) {
        Page page=new Page(pageNum,pageSize);
        LambdaQueryWrapper<Sblx> qr = new LambdaQueryWrapper<>();
        qr.like(sblx.getName()!=null,Sblx::getName,sblx.getName());
        qr.like(sblx.getBrand()!=null,Sblx::getBrand,sblx.getBrand());
        qr.eq(sblx.getStatus()!=null,Sblx::getStatus,sblx.getStatus());
        Page selectPage = baseMapper.selectPage(page, qr);
        return selectPage;
    }
}
